<%@ include file="/common/taglibs.jsp" %>
<script type="text/javascript">
	$(document).ready(function() {

        <c:if test="${reportsAreSaved}">
	       if(confirm('Would you like to enter Partner Monitoring information at this time?')) {
	    	 loadDiv('content', 'auditsForm.do?cipeprojectId=${cipeproject.id}');
	       }
	    </c:if>

	 
		 $('#pageTitle').text('<spring:message code="editReportingrequirements.short.heading" />');  // large text - make it smaller
		 
		 var currentTime = new Date()
		 var month = currentTime.getMonth() + 1
		 var day = currentTime.getDate()
		 var year = currentTime.getFullYear()
		 currentDate = new Date(month + "/" + day + "/" + year);
		 
		 // Narrative
		 $("input[id^=dueDateNar]").datepicker({
			onSelect: function(dateText, obj){
				var difference = new Date(dateText) - currentDate;
				var days = Math.round(difference/(1000*60*60*24));
				var index = parseInt(obj.id.substring('dueDateNar'.length));
				var receivedDate = $('#receivedDateNar' + index).val();
				if(days < 0) {
  					if(receivedDate == null || receivedDate == '') {
  						$('#receivedDateNar' + index).val('Overdue');
    					$('#receivedDateNar' + index).css('color', 'red');
  					}
				} else {
  					$('#receivedDateNar' + index).val('');
  					$('#receivedDateNar' + index).css('color', 'black');
				}
			}
		 });

		 $("input[id^=receivedDateNar]").datepicker();
		 $("input[id^=receivedDateNar]").change(function() {
			 if('' == this.value) {
				 var index = parseInt(this.id.substring('receivedDateNar'.length));
				 var dueDate = $('#dueDateNar' + index).val();
				 var difference = new Date(dueDate) - currentDate;
				 var days = Math.round(difference/(1000*60*60*24));
				 if(days < 0) {
					$(this).val('Overdue');
 					$(this).css('color', 'red');
				 }
			 } else if('Overdue' != this.value) {
				 $(this).css('color', 'black');
			 }
		 });
		 
// 		 $("input[id^=receivedDateNar]").change();
		 
		 $("input[id^=dueDateFin]").datepicker({
			onSelect: function(dateText, obj){
				var difference = new Date(dateText) - currentDate;
				var days = Math.round(difference/(1000*60*60*24));
				var index = parseInt(obj.id.substring('dueDateFin'.length));
				var receivedDate = $('#receivedDateFin' + index).val();
				if(days < 0) {
  					if(receivedDate == null || receivedDate == '') {
  						$('#receivedDateFin' + index).val('Overdue');
    					$('#receivedDateFin' + index).css('color', 'red');
    					$('#toGrantsFin' + index).val('Overdue');
     					$('#toGrantsFin' + index).css('color', 'red');
     					$('#receivedInGrantsFin' + index).val('Overdue');
     					$('#receivedInGrantsFin' + index).css('color', 'red');
  					}
				} else {
  					$('#receivedDateFin' + index).val('');
  					$('#receivedDateFin' + index).css('color', 'black');
  					$('#toGrantsFin' + index).val('');
 					$('#toGrantsFin' + index).css('color', 'black');
 					$('#receivedInGrantsFin' + index).val('');
 					$('#receivedInGrantsFin' + index).css('color', 'black');
				}
			}
		 });

		 $("input[id^=receivedDateFin]").datepicker({
			onSelect: function(dateText, obj){
				$(this).css('color', 'black');
				
				var difference = new Date(dateText) - currentDate;
				var days = Math.round(difference/(1000*60*60*24));
				var index = parseInt(obj.id.substring('receivedDateFin'.length));
				var toGrantsFin = $('#toGrantsFin' + index).val();
				if(days < 0) {
  					if(toGrantsFin == null || toGrantsFin == '') {
    					$('#toGrantsFin' + index).val('Overdue');
     					$('#toGrantsFin' + index).css('color', 'red');
     					$('#receivedInGrantsFin' + index).val('Overdue');
     					$('#receivedInGrantsFin' + index).css('color', 'red');
  					}
				} else {
  					$('#toGrantsFin' + index).val('');
 					$('#toGrantsFin' + index).css('color', 'black');
 					$('#receivedInGrantsFin' + index).val('');
 					$('#receivedInGrantsFin' + index).css('color', 'black');
				}
			}
		 });
		 $("input[id^=receivedDateFin]").change(function() {
			 var index = parseInt(this.id.substring('receivedDateFin'.length));
			 if('' == this.value) {
				 var dueDate = $('#dueDateFin' + index).val();
				 var difference = new Date(dueDate) - currentDate;
				 var days = Math.round(difference/(1000*60*60*24));
				 if(days < 0) {
					$(this).val('Overdue');
 					$(this).css('color', 'red');
 					$('#toGrantsFin' + index).val('Overdue');
 					$('#toGrantsFin' + index).css('color', 'red');
 					$('#receivedInGrantsFin' + index).val('Overdue');
 					$('#receivedInGrantsFin' + index).css('color', 'red');
				 }
			 } else if('Overdue' != this.value) {
				$(this).css('color', 'black');
				if($('#toGrantsFin' + index).val() == 'Overdue') {
					$('#toGrantsFin' + index).val('');
				}
				$('#toGrantsFin' + index).css('color', 'black');

				if($('#receivedInGrantsFin' + index).val() == 'Overdue') {
					$('#receivedInGrantsFin' + index).val('');
				}
				$('#receivedInGrantsFin' + index).css('color', 'black');
			 }
		 });
		 
// 		 $("input[id^=receivedDateFin]").change();

		 $("input[id^=toGrantsFin]").datepicker({
			onSelect: function(dateText, obj){
				$(this).css('color', 'black');
				
				var difference = new Date(dateText) - currentDate;
				var days = Math.round(difference/(1000*60*60*24));
				var index = parseInt(obj.id.substring('toGrantsFin'.length));
				var receivedInGrantsFin = $('#receivedInGrantsFin' + index).val();
				if(days < 0) {
  					if(receivedInGrantsFin == null || receivedInGrantsFin == '') {
    					$('#receivedInGrantsFin' + index).val('Overdue');
     					$('#receivedInGrantsFin' + index).css('color', 'red');
  					}
				} else {
 					$('#receivedInGrantsFin' + index).val('');
 					$('#receivedInGrantsFin' + index).css('color', 'black');
				}
			}
		 });
	 
		 $("input[id^=toGrantsFin]").change(function() {
			 var index = parseInt(this.id.substring('toGrantsFin'.length));
			 if('' == this.value) {
				 var receivedDate = $('#receivedDateFin' + index).val();
				 var difference = new Date(receivedDate) - currentDate;
				 var days = Math.round(difference/(1000*60*60*24));
				 if(days < 0) {
					$(this).val('Overdue');
 					$(this).css('color', 'red');
 					$('#receivedInGrantsFin' + index).val('Overdue');
 					$('#receivedInGrantsFin' + index).css('color', 'red');
				 }
			 } else if('Overdue' != this.value) {
				$(this).css('color', 'black');
				if($('#receivedInGrantsFin' + index).val() == 'Overdue') {
					$('#receivedInGrantsFin' + index).val('');					
				}
				$('#receivedInGrantsFin' + index).css('color', 'black');
			 }
		 });
// 		 $("input[id^=toGrantsFin]").change();
		 
		 $("input[id^=receivedInGrantsFin]").change(function() {
			 var index = parseInt(this.id.substring('receivedInGrantsFin'.length));
			 if('' == this.value) {
				 var toGrants = $('#toGrantsFin' + index).val();
				 var difference = new Date(toGrants) - currentDate;
				 var days = Math.round(difference/(1000*60*60*24));
				 if(days < 0) {
					$(this).val('Overdue');
 					$(this).css('color', 'red');
				 }
			 } else if('Overdue' != this.value) {
				$(this).css('color', 'black');
			 }
		 });
		 
		 $("input[id^=periodStartDate]").datepicker();
		 $("input[id^=periodEndDate]").datepicker();
		 $("input[id^=dueDate]").datepicker();
		 
		 
		 $("input[id^=receivedInGrants]").datepicker();		
		 
		 var checkUniqueFinalSelection = function(isNarType) {
				var count = 0;
				$('input[id^=' + ((isNarType) ? 'finalStrNar' : 'finalStrFin') + ']').each(function() {
					if(this.checked) count++;
				});
				if(count > 1) {
					alert('Only 1 ' + (isNarType ? 'narrative' : 'financial') + ' report can be set as final');
					return false;
				}
		 };
	
		 var checkFinalSelections = function(isNarType) {
				var count1 = 0, count2 = 0;
				$('input[id^=finalStrNar]').each(function() {
					if(this.checked) count1++;
				});
				$('input[id^=finalStrFin]').each(function() {
					if(this.checked) count2++;
				});				
				
				if(count1 == 0 || count2 == 0) {
					alert('You must select at least one of the (Narrative/Financial) reports as the Final Report');
					return false;
				}
		 };
		 
		 $('input[id^=finalStrNar]').bind("click", function() { return checkUniqueFinalSelection(true); }); 
		 $('input[id^=finalStrFin]').bind("click", function() { return checkUniqueFinalSelection(false); });
		
		 $('input[id^=reportFormSubmit]').bind("click", function() { return checkFinalSelections(); }); 
		 
		 var delSelectedRows = function(isNarType) {
				var count = 0;
				$('input[id^=' + ((isNarType) ? 'selChkNar' : 'selChkFin') + ']').each(function() {
					if(this.checked) count++;
				});
				if(count == 0) {
					alert('Please select 1 or more ' + ((isNarType) ? '\'Narrative\'' : '\'Financial\'') + 
							' progress reports and then try again.');
					return false;
				} else {
					return confirm('Are you sure to delete the selected progress reports?');
				}
		 };
		 
		 $('input[id^=delRowNar]').bind("click", function() { return delSelectedRows(true); }); 
		 $('input[id^=delRowFin]').bind("click", function() { return delSelectedRows(false); }); 
		 
		 
		 var addRow = function(isNarType) {
			return confirm('Are you sure to add a new '  + ( (isNarType) ? '\'Narrative\'' : '\'Financial\'' ) +  ' progress report?');
		 };
		 
		 $('input[id^=addRowNar]').bind("click", function() { return addRow(true); }); 
		 $('input[id^=addRowFin]').bind("click", function() { return addRow(false); });  
		 
		 $('#enterPartnerMonitoring').click(function() {
			 loadDiv('content', 'auditsForm.do?cipeprojectId=${projectReportBean.cipeprojectId}');
		 });
		 
		// $('#edtRowNar').bind("click", function() { 
		//	 loadDiv('content', 'showAddReportingrequirements.do?narEdit=true&cipeprojectId=' + <c:out value="${projectReportBean.cipeprojectId}" /> 
			//		 <c:if test="${projectReportBean.financialSectionEditable}">+ "&finEdit=true"</c:if> );
		 //});
		 
		$('#edtRowNar').click(removeOverdueFields);
		$('#delRowNar').click(removeOverdueFields);
		$('#edtRowFin').click(removeOverdueFields);
		$('#delRowFin').click(removeOverdueFields);
		$('#reportFormSubmit').click(removeOverdueFields);
		
		$('.close-button').click(function() {
		    if($("#periodStartDateNar0").attr('disabled')==undefined || $("#periodStartDateFin0").attr('disabled')==undefined){
		    	if (confirm('Are you sure you want to close the form?')){
					loadDiv('content', 'showEditPartnergrantView.do?id=${projectReportBean.cipeprojectId}');
				}
			}else {
			loadDiv('content', 'showEditPartnergrantView.do?id=${projectReportBean.cipeprojectId}');
			}
		});
	});
	
	function removeOverdueFields() {
		var receivedDateArr = $("input[id^=receivedDate]");
		for(var i = 0; i < receivedDateArr.length; i++) {
			if('Overdue' == receivedDateArr[i].value) {
				$(receivedDateArr[i]).val('');
			}
		}
		
		var arr = $("input[id^=toGrantsFin]");
		for(var i = 0; i < arr.length; i++) {
			if('Overdue' == arr[i].value) {
				$(arr[i]).val('');
			}
		}
		
		arr = $("input[id^=receivedInGrantsFin]");
		for(var i = 0; i < arr.length; i++) {
			if('Overdue' == arr[i].value) {
				$(arr[i]).val('');
			}
		}
		
		var inputs = $('#projectReportForm input');
		
		for(var i = 0; i < inputs.length; i++) {
			inputs[i].disabled = false;
		}
	}
</script>

<div id="editRepReqsDiv">
  <form:form name="projectReportForm" id="projectReportForm" action="saveProjectReportLines.do" method="post" modelAttribute="projectReportBean">
        <form:hidden path="cipeprojectId" />
        <form:hidden path="narrativeSectionEditable" />
        <form:hidden path="financialSectionEditable" />
        <form:hidden path="hasExistingReports"/>
        
	    <div class="main_form">
	    	<div class="form_head">
				<div class="floatL" style="padding-top:5px;">
							
				</div>
	    		<a href="#" class="close-button gray_btn floatR">Close Form</a><br class="clear" />
	    	</div>
	        <div class="form_cont">		
				<table width="100%">
					<tr class="row">
						<td class="input-field" colspan="3" style="text-align: center;">
							<%@ include file="/common/messages.jsp" %>
						</td>
					</tr>
					
					<tr>
					  <td>
					    <fieldset>
					       <legend>General Information</legend>
					       <table border="0" width="100%">
					         <tr>
					           <td width="47%" valign="top">
					           	   <table border="0">
							         <tr>
							           <td align="right" class="label2" nowrap="nowrap">Project ID:</td>
							           <td><c:out value="${cipeproject.projectID}"/></td>
							         </tr>
							         <tr>
							           <td align="right" class="label2" nowrap="nowrap">Start Date:</td>
							           <td>
							              <fmt:formatDate value="${cipeproject.projectStartDate}" type="date" pattern="MM/dd/yyyy" />
							           </td>
							         </tr>
							         <tr>
							           <td align="right" class="label2" nowrap="nowrap">End Date:</td>
							           <td>
							              <fmt:formatDate value="${cipeproject.projectEndDate}" type="date" pattern="MM/dd/yyyy" />
							           </td>
							         </tr>
							         <tr>
							           <td align="right" class="label2" nowrap="nowrap">Partner Name:</td>
							           <td>
							             <c:if test="${cipeproject.partner != null}">
							                <c:out value="${cipeproject.partner.partnerName}"/>
							             </c:if> 
							           </td>
							         </tr>
							         <tr>
							           <td align="right" class="label2">Title:</td>
							           <td><c:out value="${cipeproject.projectTitle}"/></td>
							         </tr>					         
							         <tr>
							           <td align="right" class="label2">Acronym:</td>
							           <td><c:out value="${cipeproject.acronym}"/></td>
							         </tr>		         				         					         					         					         					         					         
							       </table>
					           </td>
					           <td width="6%"></td>
					           <td width="47%" valign="top">
					           	   <table border="0">
							         <tr>
							           <td align="right" class="label2" nowrap="nowrap">Regional Director:</td>
							           <td>
							              <c:if test="${cipeproject.region.regionalDirector != null}">
							                <c:out value="${cipeproject.region.regionalDirector.fullName}"/>
							              </c:if>
							           </td>
							         </tr>	
							         <tr>
							           <td align="right" class="label2" nowrap="nowrap">Program Manager:</td>
							           <td>
							              <c:if test="${cipeproject.programOfficer != null}">
							                <c:out value="${cipeproject.programOfficer.fullName}"/>
							              </c:if>
							           </td>
							         </tr>	
							         <tr>
							           <td align="right" class="label2" nowrap="nowrap">Program Assistant:</td>
							           <td>
							              <c:if test="${cipeproject.programAssistant != null}">
							                <c:out value="${cipeproject.programAssistant.fullName}"/>
							              </c:if>
							           </td>
							         </tr>					         				         					         					         					         					         					         
							       </table>					           
					           </td>
					         </tr>  
					       </table>
					       
					    </fieldset>  
					    <br/><br/> 
					  </td>
					</tr>
					
					<tr>
					  <td>
					     <fieldset>
					       <legend>Narrative Progress Reports</legend>
					       <table id="tblNarrative" border="0">
					         <tr>
					           <th>Select</th>
					           <th>Period Start Date</th>
					           <th>Period End Date</th>
					           <th>Due Date</th>
					           <th>Received Date</th>
					           <th>Final?</th>
					         </tr>				         
					     
					         <c:forEach items="${projectReportBean.narrativeReports}" var="report" varStatus="row">
        					 <tr>
					             <td align="center">
					               <spring:bind path="narrativeReports[${row.index}].id">
							          <input id="selChkNar${row.index}" type="checkbox" name="selNar" value="${status.value}" <c:if test="${empty status.value || status.value=='0' || !projectReportBean.narrativeSectionEditable}">disabled='disabled'</c:if>> 
					               </spring:bind>
					               <form:hidden path="narrativeReports[${row.index}].id"/>
					               <form:hidden path="narrativeReports[${row.index}].type"/>
					             </td>
					             <td>
					               <spring:bind path="narrativeReports[${row.index}].reportperiod1">
					                 <input id="periodStartDateNar${row.index}" value="${status.value}" name="${status.expression}" style="width:90px" <c:if test="${!projectReportBean.narrativeSectionEditable || (!isGrantUser && !isAdminUser)}">disabled='disabled'</c:if> />
					               </spring:bind>  
					             </td>
					             <td>
					                <spring:bind path="narrativeReports[${row.index}].reportperiod2">
					                 <input id="periodEndDateNar${row.index}" value="${status.value}" name="${status.expression}" style="width:90px" <c:if test="${!projectReportBean.narrativeSectionEditable || (!isGrantUser && !isAdminUser)}">disabled='disabled'</c:if> />
					                </spring:bind> 
					             </td>
					             <td>
					                <spring:bind path="narrativeReports[${row.index}].reportdue">
					                 <input id="dueDateNar${row.index}" value="${status.value}" name="${status.expression}" style="width:90px" <c:if test="${!projectReportBean.narrativeSectionEditable || (!isGrantUser && !isAdminUser)}">disabled='disabled'</c:if> />
					                </spring:bind>
					             </td>
					             <td>
					                <spring:bind path="narrativeReports[${row.index}].reportreceived">
					                   <input id="receivedDateNar${row.index}" value="${status.value}" name="${status.expression}" style="width:90px;${report.narrativeReceivedDateOverDue?'color:red':''}" <c:if test="${!projectReportBean.narrativeSectionEditable || (!isStaffUser && !isKmUser && !isAdminUser)}">disabled='disabled'</c:if> />
					                </spring:bind>
					              </td>
					             <td align="center">
					               <spring:bind  path="narrativeReports[${row.index}].finalStr">
							         <input id="finalStrNar${row.index}" type="checkbox" value="true" name="${status.expression}" <c:if test="${status.value}">checked</c:if>  <c:if test="${!projectReportBean.narrativeSectionEditable || (!isGrantUser && !isAdminUser)}">disabled='disabled'</c:if>> 
					               </spring:bind>
					             </td>
					         </tr>
 					         </c:forEach>
 					         					         					         					         					         					         					         					         						         
     						 <tr>
     						   <td colspan="6">
     						   <table width="100%">
     						       <tr>
     						         <td>
     						            <c:choose>
     						              <c:when test="${!projectReportBean.narrativeSectionEditable}">
     						                <sj:submit id="edtRowNar" name="edtRowNar" cssClass="blue_btn" target="editRepReqsDiv" key="editReportingrequirements.button.ediRows"/>
     						              </c:when>
     						              <c:otherwise>
                                          <c:if test="${isGrantUser || isAdminUser}">
                                            <sj:submit id="addRowNar" name="addRowNar" cssClass="blue_btn" target="editRepReqsDiv" value="Add Row"/>
     						     		    <sj:submit id="delRowNar" name="delRowNar" cssClass="blue_btn" target="editRepReqsDiv" key="editReportingrequirements.button.deleteSelRow" tabindex="-1"/>
                                          </c:if>
     						     		  </c:otherwise>
     						     	    </c:choose>	
     						     	 </td>
     						       </tr>
     						    </table>    	 	
     						   </td>
     						 </tr>
     						 						         					         
					       </table>
					     </fieldset>
					     
					     
					     <br/><br/>
					     
					     <fieldset>
					       <legend>Financial Progress Reports</legend>
					       <table border="0">
					         <tr>
					           <th>Select</th>
					           
					           <th>Period Start Date</th>
					           <th>Period End Date</th>
					           <th>Due Date</th>
					           <th>Received</th>
					           
					           <th>Final?</th>
					           
					           <th>To Grants</th>
					           <th>Received in Grants</th>
					           
					           <th>Approved?</th>
					         </tr>

							<c:forEach items="${projectReportBean.financialReports}" var="report" varStatus="row">
     						 <tr>
					             <td align="center">
					               <spring:bind path="financialReports[${row.index}].id">
							          <input id="selChkFin${row.index}" type="checkbox" name="selFin" value="${status.value}" <c:if test="${empty status.value || status.value=='0' || !projectReportBean.financialSectionEditable}">disabled='disabled'</c:if>> 
					               </spring:bind>
					               <form:hidden path="financialReports[${row.index}].id"/>
					               <form:hidden path="financialReports[${row.index}].type"/>
					             </td>
					             <td>
					                <spring:bind path="financialReports[${row.index}].reportperiod1">
					                 <input id="periodStartDateFin${row.index}" value="${status.value}" name="${status.expression}" style="width:90px" <c:if test="${!projectReportBean.financialSectionEditable || (!isGrantUser && !isAdminUser)}">disabled='disabled'</c:if> />
					                </spring:bind> 
					             </td>
					             <td>
					                <spring:bind path="financialReports[${row.index}].reportperiod2">
					                 <input id="periodEndDateFin${row.index}" value="${status.value}" name="${status.expression}" style="width:90px" <c:if test="${!projectReportBean.financialSectionEditable || (!isGrantUser && !isAdminUser)}">disabled='disabled'</c:if> />
					                </spring:bind>
					             </td>
					             <td>
					                <spring:bind path="financialReports[${row.index}].reportdue">
					                 <input id="dueDateFin${row.index}" value="${status.value}" name="${status.expression}" style="width:90px" <c:if test="${!projectReportBean.financialSectionEditable || (!isGrantUser && !isAdminUser)}">disabled='disabled'</c:if> />
					                </spring:bind>
					             </td>
					             <td>
					               <spring:bind path="financialReports[${row.index}].reportreceived">
					                 <input id="receivedDateFin${row.index}" value="${status.value}" name="${status.expression}" style="width:90px;${(report.financialAllDatesOverDue)?'color:red':''}" <c:if test="${!projectReportBean.financialSectionEditable || (!isGrantUser && !isStaffUser && !isKmUser && !isAdminUser)}">disabled='disabled'</c:if> />
					                </spring:bind>
					             </td>
					             <td align="center">
					               <spring:bind  path="financialReports[${row.index}].finalStr">
							          <input id="finalStrFin${row.index}" type="checkbox" name="${status.expression}" value="true" <c:if test="${status.value}">checked</c:if> <c:if test="${!projectReportBean.financialSectionEditable || (!isGrantUser && !isAdminUser)}">disabled='disabled'</c:if>> 
					               </spring:bind>
					             </td>
					             <td>
								    <spring:bind  path="financialReports[${row.index}].reporttogrants">
							          <input id="toGrantsFin${row.index}" name="${status.expression}" value="${status.value}" <c:if test="${!projectReportBean.financialSectionEditable || (!isStaffUser && !isKmUser && !isAdminUser)}">disabled='disabled'</c:if> 
							          	style="width:90px;${(report.financialAllDatesOverDue || report.financialGrantDatesOverDue)?'color:red':''}"> 
					                </spring:bind>					             
					             </td>
					             <td>
									<spring:bind  path="financialReports[${row.index}].receivedingrants">
							          <input id="receivedInGrantsFin${row.index}" name="${status.expression}" value="${status.value}" <c:if test="${!projectReportBean.financialSectionEditable || (!isGrantUser && !isAdminUser)}">disabled='disabled'</c:if> 
							          	style="width:90px;${(report.financialAllDatesOverDue || report.financialGrantDatesOverDue || report.financialInGrantDateOverDue)?'color:red':''}"> 
					                </spring:bind>					             
					             </td>					             
					             <td align="center">
					               <spring:bind path="financialReports[${row.index}].approvedbyfinance">
							          <input id="approvedbyfinanceFin${row.index}" type="checkbox" name="${status.expression}" value="true" <c:if test="${status.value}">checked</c:if> <c:if test="${!projectReportBean.financialSectionEditable || (!isGrantUser && !isAdminUser)}">disabled='disabled'</c:if>> 
					               </spring:bind>
					             </td>					             
					         </tr>
      					     </c:forEach>
      					         					         					         					         					         					         					         
     						 <tr>
     						   <td colspan="9" >
     						     <table width="100%">
     						       <tr>
     						         <td>
     						           <c:choose>
     						              <c:when test="${!projectReportBean.financialSectionEditable}">
     						                <sj:submit id="edtRowFin" name="edtRowFin" cssClass="blue_btn" target="editRepReqsDiv" key="editReportingrequirements.button.ediRows" />
     						              </c:when>
     						              <c:otherwise>
                                          <c:if test="${isGrantUser || isAdminUser}">
                                            <sj:submit id="addRowFin" name="addRowFin" cssClass="blue_btn" target="editRepReqsDiv" value="Add Row"/>
     						     		    <sj:submit id="delRowFin" name="delRowFin" cssClass="blue_btn" target="editRepReqsDiv" key="editReportingrequirements.button.deleteSelRow" tabindex="-1" />
                                          </c:if>
     						     		  </c:otherwise>
     						     	    </c:choose>
     						         </td>
     						         <td align="right">
     						           <c:if test="${projectReportBean.financialSectionEditable || projectReportBean.narrativeSectionEditable}"> 
     						     		  <sj:submit id="reportFormSubmit" cssClass="blue_btn" target="editRepReqsDiv" key="editReportingrequirements.button.saveReporting" tabindex="-1"/>
     						     	   </c:if>
                                      <c:if test="${isGrantUser || isAdminUser}">
     						     		<input id="enterPartnerMonitoring" type="button" value="Enter Partner Monitoring Information" class="blue_btn"/>
                                      </c:if>
     						     	 </td>
     						       </tr>	 	
     						     </table>
     						   </td>
     						 </tr>		         
					       </table>
					       
					     </fieldset>
					     					     
					  </td>
					</tr>
				</table>
			</div>
		</div>
	</form:form>	
</div>